<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>解构赋值</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
    <div id="app">
    </div>

    <script>
        const numbers=[1,2,3];
        const [one,two,three]=numbers;
        console.log(one);
        console.log(two);
        console.log(three);

        //对象解构
        const person={
            name:'Vue',
            age:3
        };
        const {name,age}=person;
        console.log(name);
        console.log(age);

        function introduce({name,age}){
            console.log(`Hello,my name is ${name} and I am ${age} years old.`);
        }
        const student={
            name:'Vue',
            age:3
        };
        introduce(student);

    </script>
</body>
</html>
